<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0" />
<title>教务管理系统登录界面</title>

<link rel="stylesheet" type="text/css" href="bootstrap/bootstrap.min.css" />

<style type="text/css">
html,body {
	height: 100%;
}
.box {
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#6699FF', endColorstr='#6699FF'); /*  IE */
	background-image:linear-gradient(bottom, #6699FF 0%, #6699FF 100%);
	background-image:-o-linear-gradient(bottom, #6699FF 0%, #6699FF 100%);
	background-image:-moz-linear-gradient(bottom, #6699FF 0%, #6699FF 100%);
	background-image:-webkit-linear-gradient(bottom, #6699FF 0%, #6699FF 100%);
	background-image:-ms-linear-gradient(bottom, #6699FF 0%, #6699FF 100%);
	
	margin: 0 auto;
	position: relative;
	width: 100%;
	height: 100%;
}
.login-box {
	width: 100%;
	max-width:500px;
	height: 400px;
	position: absolute;
	top: 50%;

	margin-top: -200px;
	/*设置负值，为要定位子盒子的一半高度*/
	
}
@media screen and (min-width:500px){
	.login-box {
		left: 50%;
		/*设置负值，为要定位子盒子的一半宽度*/
		margin-left: -250px;
	}
}	

.form {
	width: 100%;
	max-width:500px;
	height: 275px;
	margin: 25px auto 0px auto;
	padding-top: 25px;
}	
.login-content {
	height: 300px;
	width: 100%;
	max-width:500px;
	background-color: rgba(255, 250, 2550, .6);
	float: left;
}		
	
	
.input-group {
	margin: 0px 0px 30px 0px !important;
}
.form-control,
.input-group {
	height: 40px;
}

.form-group {
	margin-bottom: 0px !important;
}
.login-title {
	padding: 20px 10px;
	background-color: rgba(0, 0, 0, .6);
}
.login-title h1 {
	margin-top: 10px !important;
}
.login-title small {
	color: #fff;
}

.link p {
	line-height: 20px;
	margin-top: 30px;
}
.btn-sm {
	padding: 8px 24px !important;
	font-size: 16px !important;
}
</style>

<script type="text/javascript">

function checkName(){
	//获取用户名输入控件对象的内容
		var username = document.getElementById("username").value;
		//信息提示框
		var name = document.getElementById("name");
		if(username == null || username == ""){
			//验证失败
			isChecked = false;
			//提示信息					
			name.innerHTML = "用户名为空！";
			
			
			//修改标志变量
			return false;
		}else{
			name.innerHTML="";
			//修改标志变量
			return true;
		}
}


function checkPsw(){
	//密码非空验证
		var userpassword = document.getElementById("password").value;
		
		//信息提示框
		var psw = document.getElementById("psw");
		if(userpassword == null || userpassword == ""){		
			
			//错误提示信息
			//提示信息					
			psw.innerHTML = "密码为空！";
			
			return false;
		}else{
			//验证通过  清空提示内容
			psw.innerHTML = "";
			return true;
		}
}


function checkMe(){
	//用户名验证
	var ischName = checkName();
	//密码验证
	var ischPsw = checkPsw();
	
	
	if(ischName && ischPsw ){
		//验证通过
		return true;
	}else{				
		return false;
		
	}
}
</script>

</head>

<body>
<div class="box">
		<div class="login-box">
			<div class="login-title text-center">
				<h1><small>教务管理系统</small></h1>
			</div>
			<div class="login-content ">
			<div class="form">
			<form action="LoginServlet" method="post">
				<div class="form-group">
					<div class="col-xs-12  ">
						<div class="input-group">
							<span class="input-group-addon"><span id="name" class="glyphicon glyphicon-user"></span></span>
							<input type="text" id="username" name="username" onblur="checkName();" class="form-control" placeholder="用户名">
						    
						</div>
					</div>
				</div>
				<div  class="form-group">
					<div style="height: 55px" class="col-xs-12  ">
						<div class="input-group">
							<span class="input-group-addon"><span id="psw" class="glyphicon glyphicon-lock"></span></span>
							<input type="password" id="password" name="password" onblur="checkPsw();" class="form-control" placeholder="密码">
						</div>
					</div>
				</div>
				
				<div style="padding-left: 85px " class="form-group">
					<div  class="col-xs-4">
						<div style=float:left class="radio">
							<input type="radio" id="role0" name="role" value="0"  >管理员
						</div>
					</div>
					<div class="col-xs-4">
						<div style=float:left class="radio">
							<input type="radio" id="role1" name="role" value="1"  >老师
						</div>
					</div>
					<div class="col-xs-4">
						<div style=float:left class="radio">
							<input type="radio" id="role2" name="role" value="2"  >学生
						</div>
					</div>
				</div>
				
				<div class="form-group form-actions">
					<div style="padding-top: 20px" class="col-xs-4 col-xs-offset-4 ">
						<button type="submit" class="btn btn-sm btn-info" onclick="return checkMe();"><span class="glyphicon glyphicon-off"></span> 登录</button>
					</div>
				</div>
				<div class="form-group">
					<div style="padding-top: 80px" class="col-xs-12">
						<p class="text-center"><small>copyright © 天津理工大学.ALL Rights Reserved.</small> 
						</p>
					</div>
				</div>
			</form>
			</div>
		</div>
	</div>
</div>


</body>

</html>